package com.telit.firecommand.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;


/**
 * 下发任务
 */
@ApiModel(description = "下发任务")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReleaseTaskDto {

    //任务类型
    @ApiModelProperty("任务类型:1巡护任务，2巡林任务")
    @NotNull(message = "任务类型不可以为空")
    private Integer taskType;

    //二级任务类型
    @ApiModelProperty(value = "二级任务类型:1日常巡护/ 2指定巡护 /3热点巡护 /4火情核实巡护 /5火情监测巡护 /6火烧轨迹巡护", required = true)
    @NotNull(message = "任务二级类型不可以为空")
    private Integer taskTypeGrade;

    //任务截止时间
    @ApiModelProperty(value = "任务截止时间", required = true)
    private String cutOffTime;

    @ApiModelProperty(value = "任务标题", required = true)
    @NotBlank(message = "任务标题不可以为空")
    @Size(max = 50, message = "任务标准过长")
    private String taskTitle;

    @ApiModelProperty(value = "任务内容", required = true)
    @NotBlank(message = "任务内容不可以为空")
    @Size(max = 255, message = "任务内容过长")
    private String taskContent;

    @ApiModelProperty(value = "执行人员ID列表", required = true)
    @NotEmpty(message = "最少指定一个任务执行人")
    private List<Long> personList = new ArrayList<>();

    //任务对应人员类型;1护林员，2林长
    @ApiModelProperty("任务对应人员类型;1护林员，2林长")
    @JsonIgnore
    private String taskPersonType;

    @JsonIgnore
    //创建人(发布人)
    private Long createBy;

    private String  realName;

    private String  regionCode;

    private Long userId;

    //    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty("巡护地点(任务为指定巡护时必传)")
    private AppointDto appoint;

    @ApiModelProperty("任务为事件核实任务时必传")
    private Long exceptionId;



    @ApiModelProperty("火情id")
    private String  fireId;

    //经度
    @ApiModelProperty(value = "经度")
    private String longitude;

    //纬度
    @ApiModelProperty(value = "纬度")
    private String latitude;

    @ApiModelProperty("火情任务(任务为火情任务时必传)")
    private FirePointDto firePointDto;

}
